var user = getUserInfo();

if(!user){
    window.confirm("没有登录, 不允许进来");
}

var vue = new Vue({
    el:"#app",
    data:{
        owner:{},
        visitors:[
            {id:"5f1c1a1e43190000f60034c2", nickname:"lyf", headImgUrl: "/images/test/personal/lyf.jpg"},
            {id:"5f1c1a1e43190000f60034c3", nickname:"qsz", headImgUrl: "/images/test/personal/qsz.jpg"},
            {id:"5f1c1a1e43190000f60034c4", nickname:"zhy", headImgUrl: "/images/test/personal/zhy.jpg"}
            ],
        totalView:"",
        todayView:""
    },
    methods:{



    },
    filters:{

    },
    mounted:function () {
        var param = getParams();
        var id=param.ownerId;
        //查询指定id的用户对象
        ajaxGet("/users/get",{id:id}, function (data) {
            vue.owner = data.data;
        });
        //visit,传入当前wo的id
        ajaxGet("/visits/visit",{id:id}, function (data) {
            var map = data.data;
            vue.visitors=map.visitors;
            vue.totalView=map.totalView;
            vue.todayView=map.todayView;
        });

    }
});
